home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_200 / 283_01 / wprintf.c < prev    next >
C/C++ Source or Header  |  1988-12-07  |  534b  |  27 lines

  1.  
  2. #include <stdarg.h>
  3. #include "ciao.h"
  4.  
  5. /* wprintf -- printf formatted string into window
  6. **            honors all the wputs ^ attribute escape commands
  7. **
  8. ** example:
  9. **   wprintf("Well, now, here are  ^1three^ little ^6%c%c%c^'s!\n",2,1,2);
  10. **
  11. */
  12.  
  13. void wprintf( char *fmt, ... )
  14. {
  15.      char *q;
  16.      va_list arg_ptr;
  17.  
  18.      if ( (q = (char *) malloc(256)) == NULL )
  19.         return;
  20.  
  21.      va_start( arg_ptr, fmt );
  22.      vsprintf( q, fmt, arg_ptr );
  23.      va_end( arg_ptr );
  24.      wputs( q );
  25.      free( q );
  26. }
  27.